Caption = "This is a very simple demonstration of the Alarm custom control. This program uses the control to update the clock every second with the current time. It also uses the control to notify the program every 10 seconds (the clock color is changed randomly every 10 seconds). Lastly, the program uses Alarm to beep every 15 minutes (on the hour, half hour, and quarter hours)."
Height = 2415
Left = 240
TabIndex = 1
Top = 960
Width = 3015
End
Begin Label Label1
Alignment = 2 'Center
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 17.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 495
Left = 240
TabIndex = 0
Top = 240
Width = 3015
End
End
Option Explicit
Const AT_Second = 0
Const AT_Hour = 1
Const AT_Minute15 = 2
Const AT_HalfHour = 3
Const AT_Minute45 = 4
Const AT_ColorChange = 10
Sub Alarm1_Alarm (AlarmIndex As Long, TimeNow As String)
Label1.Caption = TimeNow
Select Case AlarmIndex
Case AT_Hour ' beep three times on the hour
Beep
Beep
Beep
Case AT_Minute15 ' once on the quarter hour
Beep
Case AT_HalfHour ' twice on the half hour
Beep
Beep
Case AT_Minute45 ' once on the quarter hour
Beep
Case AT_ColorChange ' change colors every 10 seconds